package com.kai.steering.data.service.entity.vo;

import com.kai.steering.data.service.entity.domainObject.UserDO;
import com.kai.steering.data.service.entity.po.User;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.io.Serializable;
import java.util.Date;

/**
 * <pre>
 * 用户 VO对象
 * </pre>
 *
 * @author kai
 * @date 2022-02-23
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ToString
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "UserVO对象", description = "用户业务视图")
public class UserVO implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "账号")
    private String userId;
    @ApiModelProperty(value = "用户名")
    private String userName;
    @ApiModelProperty(value = "密码")
    private String password;
    @ApiModelProperty(value = "用户简介")
    private String introduce;
    @ApiModelProperty(value = "用户生日期")
    private Date birthday;
    @ApiModelProperty(value = "创建日期")
    private Date creationDatetime;
    @ApiModelProperty(value = "用户电话")
    private String phone;
    @ApiModelProperty(value = "用户地址")
    private String address;
    @ApiModelProperty(value = "仓库id")
    private String warehouseId;

    public UserVO(UserDO userDO) {
        this.userId=userDO.getUserId();
        this.userName=userDO.getUserName();
        this.password=userDO.getPassword();
        this.introduce=userDO.getIntroduce();
        this.birthday=userDO.getBirthday();
        this.creationDatetime=userDO.getCreationDatetime();
        this.phone=userDO.getPhone();
        this.address=userDO.getAddress();
        this.warehouseId=userDO.getWarehouseId();
    }

    public UserVO(User user) {
        this.userId=user.getUserId();
        this.userName=user.getUserName();
        this.password=user.getPassword();
        this.introduce=user.getIntroduce();
        this.birthday=user.getBirthday();
        this.creationDatetime=user.getCreationDatetime();
        this.phone=user.getPhone();
        this.address=user.getAddress();
        this.warehouseId=user.getWarehouseId();
    }
}